package com.example.springdemo0921.springboot;

import com.example.springdemo0921.Person;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Getter
@Setter

@Configuration  //        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(JavaBeanConfiguration.class);
@Import(Person.class)
@ConfigurationProperties
@Slf4j
public class JavaBeanConfiguration {
    private ProductRateConfig productRateConfig;


    @Bean
    public ProductRateConfig productRateConfig() {
        return productRateConfig;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
    }

}
